/*
 * Copyright (c) 2015 www.smarthome.com All rights reserved. 本软件源代码版权归----所有,未经许可不得任意复制与传播.
 */
package com.smarthome.domain.bean;

import java.util.Date;
import java.util.List;

import org.springframework.format.annotation.DateTimeFormat;

import com.smarthome.domain.bean.base.BaseDomain;
import com.smarthome.domain.enums.ShUserSuperFlagEnum;

/**
 * shUser
 * 
 * @author KongXiangyu
 * @since 2015-09-07
 */
public class ShUser extends BaseDomain {

    private static final long serialVersionUID = 1L;
    private Long employeeId;
    private String loginName;
    private String loginPwd;
    private Integer status;
    private Date lastLoginTime;
    private Integer superFlag;
    private Date gmtCreate;
    private Date gmtModify;

    private Integer active;

    /** 附加属性 **/
    private String roleIds;
    private String roleNames;

    private ShResidence currentResidence;
    private List<ShUserRole> roles;
    private List<ShResidence> residences;
    private List<ShUserResource> resources;
    private ShPropertyEmployee employee;

    private String employeeName;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startGmtCreate;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endGmtCreate;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startGmtModify;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endGmtModify;

    private Long residenceId;
    
    public ShUser() {
        // 默认无参构造方法
    }

    /**
     * 获取 employeeId
     * 
     * @return
     */
    public Long getEmployeeId() {
        return employeeId;
    }

    /**
     * 设置 employeeId
     * 
     * @param employeeId
     */
    public void setEmployeeId(Long employeeId) {
        this.employeeId = employeeId;
    }

    /**
     * 获取 loginName
     * 
     * @return
     */
    public String getLoginName() {
        return loginName;
    }

    /**
     * 设置 loginName
     * 
     * @param loginName
     */
    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    /**
     * 获取 loginPwd
     * 
     * @return
     */
    public String getLoginPwd() {
        return loginPwd;
    }

    /**
     * 设置 loginPwd
     * 
     * @param loginPwd
     */
    public void setLoginPwd(String loginPwd) {
        this.loginPwd = loginPwd;
    }

    /**
     * 获取 status
     * 
     * @return
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * 设置 status
     * 
     * @param status
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * 获取 lastLoginTime
     * 
     * @return
     */
    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    /**
     * 设置 lastLoginTime
     * 
     * @param lastLoginTime
     */
    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    /**
     * 获取 superFlag
     * 
     * @return
     */
    public Integer getSuperFlag() {
        return superFlag;
    }

    /**
     * 设置 superFlag
     * 
     * @param superFlag
     */
    public void setSuperFlag(Integer superFlag) {
        this.superFlag = superFlag;
    }

    /**
     * 获取 gmtCreate
     * 
     * @return
     */
    public Date getGmtCreate() {
        return gmtCreate;
    }

    /**
     * 设置 gmtCreate
     * 
     * @param gmtCreate
     */
    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    /**
     * 获取 gmtModify
     * 
     * @return
     */
    public Date getGmtModify() {
        return gmtModify;
    }

    /**
     * 设置 gmtModify
     * 
     * @param gmtModify
     */
    public void setGmtModify(Date gmtModify) {
        this.gmtModify = gmtModify;
    }

    public String getRoleIds() {
        return roleIds;
    }

    public void setRoleIds(String roleIds) {
        this.roleIds = roleIds;
    }

    public String getRoleNames() {
        return roleNames;
    }

    public void setRoleNames(String roleNames) {
        this.roleNames = roleNames;
    }

    public String getEmployeeName() {
        return employeeName;
    }

    public void setEmployeeName(String employeeName) {
        this.employeeName = employeeName;
    }

    public Date getStartGmtCreate() {
        return startGmtCreate;
    }

    public void setStartGmtCreate(Date startGmtCreate) {
        this.startGmtCreate = startGmtCreate;
    }

    public Date getEndGmtCreate() {
        return endGmtCreate;
    }

    public void setEndGmtCreate(Date endGmtCreate) {
        this.endGmtCreate = endGmtCreate;
    }

    public Date getStartGmtModify() {
        return startGmtModify;
    }

    public void setStartGmtModify(Date startGmtModify) {
        this.startGmtModify = startGmtModify;
    }

    public Date getEndGmtModify() {
        return endGmtModify;
    }

    public void setEndGmtModify(Date endGmtModify) {
        this.endGmtModify = endGmtModify;
    }

    public boolean isSuperAdmin() {
        return superFlag == ShUserSuperFlagEnum.SUPER.getFlag();
    }

    public Integer getActive() {
        return active;
    }

    public void setActive(Integer active) {
        this.active = active;
    }

    public List<ShUserRole> getRoles() {
        return roles;
    }

    public void setRoles(List<ShUserRole> roles) {
        this.roles = roles;
    }

    public ShPropertyEmployee getEmployee() {
        return employee;
    }

    public void setEmployee(ShPropertyEmployee employee) {
        this.employee = employee;
    }

    public List<ShResidence> getResidences() {
        return residences;
    }

    public void setResidences(List<ShResidence> residences) {
        this.residences = residences;
    }

    public List<ShUserResource> getResources() {
        return resources;
    }

    public void setResources(List<ShUserResource> resources) {
        this.resources = resources;
    }

    public ShResidence getCurrentResidence() {
        return currentResidence;
    }

    public void setCurrentResidence(ShResidence currentResidence) {
        this.currentResidence = currentResidence;
    }

	public Long getResidenceId() {
		return residenceId;
	}
	
	public void setResidenceId(Long residenceId) {
		this.residenceId = residenceId;
	}
}